import React, { memo } from 'react';
import { HashRouter } from 'react-router-dom';
// Provider用于全局暴露store
import { Provider } from 'react-redux'
//对路由进行集中式的管理
import { renderRoutes } from "react-router-config"


import routes from './router'
import store from './store'

import AppHeader from '@/components/app-header';
import AppFooter from '@/components/app-footer';
import AppPlayerBar from './components/player/app-palyer-bar';

const App = memo(() => {
  return (
    <Provider store={store}>
      <HashRouter>
        <AppHeader />
        {/* 这里是路由占位 路由映射的内容都在这里 */}
        {renderRoutes(routes)}
        <AppFooter />
        <AppPlayerBar/>
      </HashRouter>
    </Provider>

  );
});

export default App;